<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /fasttmp/mkdist-qt-4.3.5-1211793125/qtopia-core-opensource-src-4.3.5/src/gui/painting/qprinter.cpp -->
<head>
  <title>Qt 4.3: QPrintEngine Class Reference</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><h1 align="center">QPrintEngine Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1>
<p>The QPrintEngine class defines an interface for how <a href="qprinter.html">QPrinter</a> interacts with a given printing subsystem. <a href="#details">More...</a></p>
<pre> #include &lt;QPrintEngine&gt;</pre><ul>
<li><a href="qprintengine-members.html">List of all members, including inherited members</a></li>
</ul>
<a name="public-types"></a>
<h3>Public Types</h3>
<ul>
<li><div class="fn"/>enum <b><a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a></b> { PPK_CollateCopies, PPK_ColorMode, PPK_Creator, PPK_Duplex, ..., PPK_CustomBase }</li>
</ul>
<a name="public-functions"></a>
<h3>Public Functions</h3>
<ul>
<li><div class="fn"/>virtual <b><a href="qprintengine.html#dtor.QPrintEngine">~QPrintEngine</a></b> ()</li>
<li><div class="fn"/>virtual bool <b><a href="qprintengine.html#abort">abort</a></b> () = 0</li>
<li><div class="fn"/>virtual int <b><a href="qprintengine.html#metric">metric</a></b> ( QPaintDevice::PaintDeviceMetric <i>id</i> ) const = 0</li>
<li><div class="fn"/>virtual bool <b><a href="qprintengine.html#newPage">newPage</a></b> () = 0</li>
<li><div class="fn"/>virtual QPrinter::PrinterState <b><a href="qprintengine.html#printerState">printerState</a></b> () const = 0</li>
<li><div class="fn"/>virtual QVariant <b><a href="qprintengine.html#property">property</a></b> ( PrintEnginePropertyKey <i>key</i> ) const = 0</li>
<li><div class="fn"/>virtual void <b><a href="qprintengine.html#setProperty">setProperty</a></b> ( PrintEnginePropertyKey <i>key</i>, const QVariant &amp; <i>value</i> ) = 0</li>
</ul>
<a name="details"></a>
<hr />
<h2>Detailed Description</h2>
<p>The QPrintEngine class defines an interface for how <a href="qprinter.html">QPrinter</a> interacts with a given printing subsystem.</p>
<p>The common case when creating your own print engine is to derive from both <a href="qpaintengine.html">QPaintEngine</a> and QPrintEngine. Various properties of a print engine are given with <a href="qprintengine.html#property">property</a>() and set with <a href="qprintengine.html#setProperty">setProperty</a>().</p>
<p>See also <a href="qpaintengine.html">QPaintEngine</a>.</p>
<hr />
<h2>Member Type Documentation</h2>
<h3 class="fn"><a name="PrintEnginePropertyKey-enum"></a>enum QPrintEngine::PrintEnginePropertyKey</h3>
<p>This enum is used to communicate properties between the print engine and <a href="qprinter.html">QPrinter</a>. A property may or may not be supported by a given print engine.</p>
<p><table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_CollateCopies</tt></td><td align="center" valign="top"><tt>0</tt></td><td valign="top">A boolean value indicating whether the printout should be collated or not.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_ColorMode</tt></td><td align="center" valign="top"><tt>1</tt></td><td valign="top">Refers to <a href="qprinter.html#ColorMode-enum">QPrinter::ColorMode</a>, either color or monochrome.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_Creator</tt></td><td align="center" valign="top"><tt>2</tt></td><td valign="top">A string describing the document's creator.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_Duplex</tt></td><td align="center" valign="top"><tt>21</tt></td><td valign="top">A boolean value indicating whether both sides of the printer paper should be used for the printout.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_DocumentName</tt></td><td align="center" valign="top"><tt>3</tt></td><td valign="top">A string describing the document name in the spooler.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_FontEmbedding</tt></td><td align="center" valign="top"><tt>19</tt></td><td valign="top">A boolean value indicating whether data for the document's fonts should be embedded in the data sent to the printer.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_FullPage</tt></td><td align="center" valign="top"><tt>4</tt></td><td valign="top">A boolean describing if the printer should be full page or not.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_NumberOfCopies</tt></td><td align="center" valign="top"><tt>5</tt></td><td valign="top">An integer specifying the number of copies</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_Orientation</tt></td><td align="center" valign="top"><tt>6</tt></td><td valign="top">Specifies a <a href="qprinter.html#Orientation-enum">QPrinter::Orientation</a> value.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_OutputFileName</tt></td><td align="center" valign="top"><tt>7</tt></td><td valign="top">The output file name as a string. An empty file name indicates that the printer should not print to a file.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PageOrder</tt></td><td align="center" valign="top"><tt>8</tt></td><td valign="top">Specifies a <a href="qprinter.html#PageOrder-enum">QPrinter::PageOrder</a> value.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PageRect</tt></td><td align="center" valign="top"><tt>9</tt></td><td valign="top">A <a href="qrect.html">QRect</a> specifying the page rectangle</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PageSize</tt></td><td align="center" valign="top"><tt>10</tt></td><td valign="top">Specifies a <a href="qprinter.html#PageSize-enum">QPrinter::PageSize</a> value.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PaperRect</tt></td><td align="center" valign="top"><tt>11</tt></td><td valign="top">A <a href="qrect.html">QRect</a> specifying the paper rectangle.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PaperSource</tt></td><td align="center" valign="top"><tt>12</tt></td><td valign="top">Specifies a <a href="qprinter.html#PaperSource-enum">QPrinter::PaperSource</a> value.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PaperSources</tt></td><td align="center" valign="top"><tt>22</tt></td><td valign="top">Specifies more than one <a href="qprinter.html#PaperSource-enum">QPrinter::PaperSource</a> value.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PrinterName</tt></td><td align="center" valign="top"><tt>13</tt></td><td valign="top">A string specifying the name of the printer.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_PrinterProgram</tt></td><td align="center" valign="top"><tt>14</tt></td><td valign="top">A string specifying the name of the printer program used for printing,</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_Resolution</tt></td><td align="center" valign="top"><tt>15</tt></td><td valign="top">An integer describing the dots per inch for this printer.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_SelectionOption</tt></td><td align="center" valign="top"><tt>16</tt></td><td valign="top">&nbsp;</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_SupportedResolutions</tt></td><td align="center" valign="top"><tt>17</tt></td><td valign="top">A list of integer QVariants describing the set of supported resolutions that the printer has.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_SuppressSystemPrintStatus</tt></td><td align="center" valign="top"><tt>20</tt></td><td valign="top">Suppress the built-in dialog for showing printing progress. As of 4.1 this only has effect on Mac OS X where, by default, a status dialog is shown.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_WindowsPageSize</tt></td><td align="center" valign="top"><tt>18</tt></td><td valign="top">An integer specifying a DM_PAPER entry on Windows.</td></tr>
<tr><td valign="top"><tt>QPrintEngine::PPK_CustomBase</tt></td><td align="center" valign="top"><tt>0xff00</tt></td><td valign="top">Basis for extension.</td></tr>
</table></p>
<hr />
<h2>Member Function Documentation</h2>
<h3 class="fn"><a name="dtor.QPrintEngine"></a>QPrintEngine::~QPrintEngine ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
<p>Destroys the print engine.</p>
<h3 class="fn"><a name="abort"></a>bool QPrintEngine::abort ()&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Instructs the print engine to abort the printing process. Returns true if successful; otherwise returns false.</p>
<h3 class="fn"><a name="metric"></a>int QPrintEngine::metric ( <a href="qpaintdevice.html#PaintDeviceMetric-enum">QPaintDevice::PaintDeviceMetric</a> <i>id</i> ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the metric for the given <i>id</i>.</p>
<h3 class="fn"><a name="newPage"></a>bool QPrintEngine::newPage ()&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Instructs the print engine to start a new page. Returns true if the printer was able to create the new page; otherwise returns false.</p>
<h3 class="fn"><a name="printerState"></a><a href="qprinter.html#PrinterState-enum">QPrinter::PrinterState</a> QPrintEngine::printerState () const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the current state of the printer being used by the print engine.</p>
<h3 class="fn"><a name="property"></a><a href="qvariant.html">QVariant</a> QPrintEngine::property ( <a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a> <i>key</i> ) const&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Returns the print engine's property specified by <i>key</i>.</p>
<p>See also <a href="qprintengine.html#setProperty">setProperty</a>().</p>
<h3 class="fn"><a name="setProperty"></a>void QPrintEngine::setProperty ( <a href="qprintengine.html#PrintEnginePropertyKey-enum">PrintEnginePropertyKey</a> <i>key</i>, const <a href="qvariant.html">QVariant</a> &amp; <i>value</i> )&nbsp;&nbsp;<tt> [pure virtual]</tt></h3>
<p>Sets the print engine's property specified by <i>key</i> to the given <i>value</i>.</p>
<p>See also <a href="qprintengine.html#property">property</a>().</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2008 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.3.5</div></td>
</tr></table></div></address></body>
</html>
